
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VehicleInspections_fk]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[VehicleInspection] DROP CONSTRAINT VehicleInspections_fk
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Vehicle]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Vehicle]
GO

CREATE TABLE [dbo].[Vehicle] (
	[VehicleId] [int] IDENTITY (1, 1) NOT NULL ,
	[EngineNo] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ManufactureDate] [datetime] NULL ,
	[CarExpiryDate] [datetime] NULL ,
	[RegistrationDueDate] [datetime] NULL ,
	[InspectionDate] [datetime] NULL ,
	[PurchasePrice] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OwnerId] [int] NULL ,
	[PurchaseDate] [datetime] NULL ,
	[Rego] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BodyType] [int] NULL ,
	[Model] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Active] [INT] NULL 
) ON [PRIMARY]
GO

